package com.czk.service.userservice.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.czk.dao.UserDao;
import com.czk.pojo.User;
import com.czk.service.userservice.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/9/29 15:52
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    @DS("slave") // 切换数据库的注释
    public User selectById(int id) {
        return userDao.selectById(id);
    }
}
